package constants

// Definition
const (
	MAX_TIME_STAMP_DIFF              = 10 * 60 * 1000
	NONCE_CACHE_TIME                 = 10 * 60 * 1000 * 2 // MAX_TIME_STAMP_DIFF * 2
	TIMESTAMP_LEN                    = 13
	CMK_EFFECTIVE_DURATION           = 1 * 365 * 24 * 60 * 60 * 1000
	CMK_LOOP_CLEAR_TIME              = 24 * 60 * 60 * 1000
	CMK_EXPIRE_TIME_EXPAND           = 10 * 24 * 60 * 60 * 1000
	CMK_LOOP_CLEAR_EXECUTION_TIME    = 3
	SM_SECRET_VERSION_STAGE_CURRENT  = 1
	SM_SECRET_VERSION_STAGE_PREVIOUS = 0
	DEFAULT_DELETE_RECOVERY_DAYS     = 30
	MAX_NONCE_LEN                    = 64
	FFI_BUFFER_SIZE                  = 10000
)

// ehsm_keySpec_t
const (
	EH_AES_GCM_128 = 1
	EH_AES_GCM_192 = 2
	EH_AES_GCM_256 = 3
	EH_RSA_2048    = 10
	EH_RSA_3072    = 11
	EH_RSA_4096    = 12
	EH_EC_P224     = 20
	EH_EC_P256     = 21
	EH_EC_P256K    = 22
	EH_EC_P384     = 23
	EH_EC_P521     = 24
	EH_SM2         = 30
	EH_SM4_CTR     = 31
	EH_SM4_CBC     = 32
	EH_HMAC        = 40
)

// ehsm_keyorigin_t
const (
	EH_INTERNAL_KEY = 1
	EH_EXTERNAL_KEY = 2
)

// ehsm_padding_mode_t
const (
	EH_PAD_NONE       = 0
	EH_RSA_PKCS1      = 1
	EH_RSA_PKCS1_PSS  = 2
	EH_RSA_PKCS1_OAEP = 3
)

// ehsm_keyusage_t
const (
	EH_KEYUSAGE_ENCRYPT_DECRYPT = 1
	EH_KEYUSAGE_SIGN_VERIFY     = 2
)

// ehsm_message_type_t
const (
	EH_RAW    = 1
	EH_DIGEST = 2
)

// ehsm_digest_mode_t
const (
	EH_SHA_224 = 1
	EH_SHA_256 = 2
	EH_SHA_384 = 3
	EH_SHA_512 = 4
	EH_SM3     = 5
)
